package de.uni_mannheim;

import java.util.ArrayList;
import java.util.List;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class ScheduleSaxHandler extends DefaultHandler {
	public static final String ELEM_NAME = "event-metadata";
	public static final String ATTR_NAME = "event-key";

	private List<Integer> matchIds;

	@Override
	public void startDocument() {
		matchIds = new ArrayList<Integer>();
	}

	@Override
	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {

		if (qName.equalsIgnoreCase(ELEM_NAME)) {
			matchIds.add(Integer.parseInt(attributes.getValue(ATTR_NAME)));
		}

	}

	public List<Integer> getMatchIds() {
		return matchIds;
	}

}
